Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch unanticipated EOFException due to empty stream when redirecting. #501

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

customautosys
Copy link

When one wants to disable followRedirect, sometimes the InputStream will throw an EOFException due to there being no content in the response body. It is undesired for this to result in an error returned to Cordova, as the end user would just want to be able to read the Location header anyway (and follow it if necessary).

progress.onUpload(totalWritten, totalSize);
}
}catch(EOFException e){
e.printStackTrace();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also be done in the copy(Reader that follows? given it has a similar while ((read = input.read(buffer)) … loop.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants